package vn.edu.saigontech.ncms.web.student;

import vn.edu.saigontech.ncms.util.Checker;
import vn.edu.saigontech.ncms.web.AbstractValidator;

@SuppressWarnings("serial")
public class ValidatePlacementShiftAction extends AbstractValidator {
	private Long id;
	private String startTime;
	private String endTime;
	
	@Override
	public String check() {
		if(Checker.isEmpty(this.startTime)) {
			this.sendKeyError("validator.required", "startTime");
		}
		if(!Checker.isTime(this.startTime, this.i18n("format.time"))) {
			this.sendKeyError("validator.mask", "startTime", "format.time");
		}
		if(Checker.isEmpty(this.endTime)) {
			this.sendKeyError("validator.required", "endTime");
		}
		if(!Checker.isTime(this.endTime, this.i18n("format.time"))) {
			this.sendKeyError("validator.mask", "endTime", "format.time");
		}
		return this.toSuccess();
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
}
